#!/bin/bash
#leao:Thu Aug 22 01:58:14 PM CST 2024
judgeTime(){
    if [ -z "$1" ] || [ -z "$2" ];then
    echo "参数不合法"
    exit 1
    fi
    if [ "$1" -nt "$2" ];then
    return 1
    elif [ "$1" -ot "$2" ];then
    return 2
    else
    return 3
    fi
}
file1=$1
file2=$2
judgeTime "$file1" "$file2"
ret=$?
if [ $ret -eq 1 ];then
    echo "${file1}创建时间晚于${file2}"
elif [ $ret -eq 2 ];then
    echo "${file1}创建时间早于${file2}"
else
     echo "${file1}和${file2}创建时间相同"
fi
